import React from 'react'
import Home from '../home'
import Category from '../category'
import Bar from '../charts/bar'
import Line from '../charts/line'
import Pie from '../charts/pie'
import Product from '../product'
import Error404 from '../error/Error404.jsx'
import Role from '../role'
import User from '../user'
import { Switch, Route, Redirect } from 'react-router-dom'
/**
 * 路由组件
 */
export default (
  <Switch>
    <Redirect exact from="/" to="/home"></Redirect>
    <Route path="/home" component={Home}></Route>
    <Route path="/goods/category" component={Category}></Route>
    <Route path="/charts/bar" component={Bar}></Route>
    <Route path="/charts/line" component={Line}></Route>
    <Route path="/charts/pie" component={Pie}></Route>
    <Route path="/goods/product" component={Product}></Route>
    <Route path="/role" component={Role}></Route>
    <Route path="/user" component={User}></Route>
    <Route component={Error404}></Route>
  </Switch>
)
